package com.information;

import java.util.ArrayList;
import java.util.List;

public class InfoMain {

    public static void main(String[] args) {
        System.out.println("消息列表=" + infoList());
    }

    /**
     * 获取消息列表
     * @return
     */
    public static List<String> infoList() {
        List<String> infoList = new ArrayList<>(20);

        if (0== InformationList.recommendInfo.size()) {
            return infoList;
        }

        if (4 <= InformationList.recommendInfo.size()) {
            List<String> sysInfoList = InformationList.sysInfo.subList(0, 17);
            List<String> recommendInfoList = InformationList.recommendInfo.subList(0, 5);
            infoList.addAll(recommendInfoList);
            infoList.addAll(sysInfoList);
            return infoList;
        }

        List<String> recommendInfoList = InformationList.recommendInfo.subList(0, InformationList.recommendInfo.size());
        List<String> sysInfoList = InformationList.sysInfo.subList(0, InformationList.recommendInfo.size() * 5);
        infoList.addAll(recommendInfoList);
        infoList.addAll(sysInfoList);
        return infoList;
    }
}
